﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace Core.Xml.Ogc.Ows
{
    class AllowedValues : IXmlIsland, IPossibleValue
    {
        public List<ValueType> Values { get; set; }
        public List<RangeType> Ranges { get; set; }

        public XElement CreateXElement()
        {
            XElement allowedValues = new XElement(Namespaces.OWS + "AllowedValues");

            for (int i = 0; i < Values.Count; i++)
                allowedValues.Add(Values[i].CreateXElement(Namespaces.OWS + "Value"));

            for (int i = 0; i < Ranges.Count; i++)
                allowedValues.Add(Ranges[i].CreateXElement(Namespaces.OWS + "Range"));

            return allowedValues;
        }
    }
}
